<style>
.source_name{width:20%;}
td.source_name{text-align:left;}
.Tselect select{border:1px solid #CCCCCC;border-radius:5px;padding-left:5px;height: 30px;width: 100px;}
.Tselect select option{padding-left: 5px;}
.Tsearch input{height: 30px;border-radius: 5px;border: 1px solid #CCCCCC;padding-left: 5px;line-height: 30px;}

</style>
<div class="row">
	<div class="col-xs-6">
		<!-- 表示一个成功的或积极的动作 -->
		<a href="{:U('Source/index')}"><button type="button" class="btn btn-primary">分享管理</button></a>
		<a href="{:U('Source/album')}"><button type="button" class="btn btn-primary  active">专辑管理</button></a>
		<button type="button" class="btn btn-primary"  data-toggle="modal" data-target="#myModal">专辑批量采集</button>
	</div>
<section class="col-xs-3 Tselect">
		<form role="form">
		     <select name="sortT" class="option">
		     	<option value="default">默认</option>
				<option value="new" >最新</option>
				<option value="tCnt" >转存</option>
				<option value="dCnt" >下载</option>
				<option value="vCnt" >浏览</option>
				<option value="click" >点击</option>
			</select>
			<button type="submit" class="btn btn-default">排序</button>
		</form>
	</section>
		<section class="col-xs-3 Tsearch">
			<form role="form">
				<input type="text" name="kw" placeholder="资源名称" value="{$Think.get.kw}"/>    
				<button type="submit" class="btn btn-default">搜索</button>
			</form>
		</section>
</div>
<table class="table table-hover table-responsive">
   <thead>
      <tr>
         <th class="source_name">名称</th>
         <th>浏览</th>
         <th>保存</th>
         <th>下载</th>
         <th>点击</th>
         <th>资源数量</th>
         <th>状态</th>
         <th>操作</th>
         <th>收录时间</th>
      </tr>
   </thead>
   <tbody>
   <volist name="data" id="data">
      <tr>
         <td class="source_name"><a href="{:U('Home/Album/detail',array('id'=>$data['id']))}" target="_blank">{$data.title}</a></td>
         <td>{$data.click}</td>
         <td>{$data.tCnt}</td>
         <td>{$data.dCnt}</td>
         <td>{$data.click}</td>
         <td>{$data.filecount}</td>
         <td>
				<switch name="data.status" >
				<case value="1"><span style="color:green;">已采集</span></case>
				<case value="0"><span style="color:red;">未采集</span></case>
				</switch>
         </td>
         <td>
         	<a href="{:U('Source/getAlbumSource',array('album_id'=>$data['album_id'],'uk'=>$data['uk'],'num'=>$data['filecount']))}">采集</a> 
         	<a href="{:U('Home/Album/detail',array('id'=>$data['id']))}" target="_blank">查看 </a> 
         	<a href="{:U('Source/delete_album',array('album_id'=>$data['album_id']))}" class="delete_album">删除</a>
         </td>
         <td>{$data.time|date="Y-m-d H:i:s",###}</td>
      </tr>
    </volist>
   </tbody>
</table>
{$page}
<!-- 模态框（Modal） -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" 
   aria-labelledby="myModalLabel" aria-hidden="true">
   <div class="modal-dialog">
      <div class="modal-content">
         <div class="modal-body">
         <form role="form" id="collect_form" method="get" action="{:U('Source/batchAlbum')}">
  			<div class="form-group">
    			<label for="content">本次采集专辑个数</label>
    			<input id="content" type="number" name="num" value="20" class="form-control" rows="10" placeholder='请输入您每次需要采集的数量'></input>
  			</div>
  			<div class="form-group">
  				<label>是否重复采集</label>
				 <label class="checkbox-inline">
				      <input type="radio" name="status" id="optionsRadios3" value="1" >是
				   </label>
				   <label class="checkbox-inline">
				      <input type="radio" name="status" id="optionsRadios4"  value="0" checked>否
				   </label>
  			</div>
		</form>
         </div>
         
         <div class="modal-footer">
            <button type="button" class="btn btn-default" 
               data-dismiss="modal">关闭
            </button>
            <button type="button" id="collect" class="btn btn-primary">
               马上采集收录
            </button>
         </div>
      </div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>
<script>
$(function(){
	$("#collect").click(function(){
		$("#collect_form").submit();
	});
	$(".delete_album").click(function(){
		if(!confirm('您确定要删除该专辑吗？删除该专辑同时将删除该专辑下的资源。')) return false;
	});
	
	 //默认选项
   		var sortT="{$Think.get.sortT}";
   		$option=$('.option option');
   		$.each($option, function() {    
   			if($(this).val() ==sortT){
   				$(this).attr('selected','selected');
   			}
   		});
});

</script>







